/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * HealthPlanSelection.java
 *
 * Created on Aug 30, 2011, 2:09:58 PM
 */
package employeemanagement;

/**
 *
 * @author pruthadesai
 */
public class HealthPlanSelection extends javax.swing.JFrame {

        Level1Strategy l1;
        Level2Strategy l2;
        Level3Strategy l3;
        EmployeeLevel1 el1;
        EmployeeLevel2 el2;
        EmployeeLevel3 el3;
        int i1=0,i2=0,i3=0;

    /** Creates new form HealthPlanSelection */
    public HealthPlanSelection() {
        initComponents();
    }

    public HealthPlanSelection(HealthPlanStrategy e,int i,String header, EmployeeLevelFactory ef){
        initComponents();
        
        if(i==1){
             l1 = (Level1Strategy)e;
             el1 = (EmployeeLevel1)ef;
        lblHeader.setText(header);
        lblSection1.setText(l1.subSection1);
        lblSection2.setText(l1.subSection2);
        lblSection3.setText(l1.subSection3);
        rbnsssec11.setText(l1.subSubSection11);
        rbnsssec12.setText(l1.subSubSection12);
        rbnsssec13.setText(l1.subSubSection13);
        rbnsssec21.setText(l1.subSubSection21);
        rbnsssec22.setText(l1.subSubSection22);
        rbnsssec23.setText(l1.subSubSection23);
        chkChoice1.setText(l1.subSubSection31);
        chkChoice2.setText(l1.subSubSection32);
        lblHeader.setVisible(true);
        lblSection1.setVisible(true);
        lblSection2.setVisible(true);
        lblSection3.setVisible(true);
        rbnsssec11.setVisible(true);
        rbnsssec12.setVisible(true);
        rbnsssec13.setVisible(true);
        rbnsssec21.setVisible(true);
        rbnsssec22.setVisible(true);
        rbnsssec23.setVisible(true);
        chkChoice1.setVisible(true);
        chkChoice2.setVisible(true);

        }else if(i==2){
             l2 = (Level2Strategy)e;
             el2 = (EmployeeLevel2)ef;
        lblHeader.setText(header);
        lblSection1.setText(l2.subSection1);
        lblSection2.setText(l2.subSection2);
        rbnsssec11.setText(l2.subSubSection11);
        rbnsssec12.setText(l2.subSubSection12);
        rbnsssec13.setText(l2.subSubSection13);
        rbnsssec21.setText(l2.subSubSection22);
        lblHeader.setVisible(true);
        lblSection1.setVisible(true);
        lblSection2.setVisible(true);
        rbnsssec11.setVisible(true);
        rbnsssec12.setVisible(true);
        rbnsssec13.setVisible(true);
        rbnsssec21.setVisible(true);
        lblSection3.setVisible(false);
        rbnsssec22.setVisible(false);
        rbnsssec23.setVisible(false);
        chkChoice1.setVisible(false);
        chkChoice2.setVisible(false);

        }else if(i==3){
             l3 = (Level3Strategy)e;
             el3 = (EmployeeLevel3)ef;
             lblHeader.setText(header);
             lblHeader.setVisible(true);
                     lblSection1.setVisible(false);
        
                     lblSection2.setVisible(false);
        rbnsssec11.setVisible(false);
        rbnsssec12.setVisible(false);
        rbnsssec13.setVisible(false);
        rbnsssec21.setVisible(false);
        lblSection3.setVisible(false);
        rbnsssec22.setVisible(false);
        rbnsssec23.setVisible(false);
        chkChoice1.setVisible(false);
        chkChoice2.setVisible(false);

        }

        setVisible(true);
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        lblHeader = new javax.swing.JLabel();
        lblSection1 = new javax.swing.JLabel();
        rbnsssec11 = new javax.swing.JRadioButton();
        rbnsssec12 = new javax.swing.JRadioButton();
        rbnsssec13 = new javax.swing.JRadioButton();
        lblSection2 = new javax.swing.JLabel();
        rbnsssec21 = new javax.swing.JRadioButton();
        rbnsssec22 = new javax.swing.JRadioButton();
        rbnsssec23 = new javax.swing.JRadioButton();
        lblSection3 = new javax.swing.JLabel();
        chkChoice1 = new javax.swing.JCheckBox();
        chkChoice2 = new javax.swing.JCheckBox();
        jButton1 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "DesignPatterns Inc.", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Gabriola", 1, 24))); // NOI18N

        jPanel2.setBackground(new java.awt.Color(255, 255, 255));
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Health Plan Details", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Lucida Grande", 0, 16), new java.awt.Color(0, 0, 255))); // NOI18N

        lblHeader.setText("Header");

        lblSection1.setText("Section1");

        rbnsssec11.setText("jRadioButton1");
        rbnsssec11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbnsssec11ActionPerformed(evt);
            }
        });

        rbnsssec12.setText("jRadioButton1");
        rbnsssec12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbnsssec12ActionPerformed(evt);
            }
        });

        rbnsssec13.setText("jRadioButton1");
        rbnsssec13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbnsssec13ActionPerformed(evt);
            }
        });

        lblSection2.setText("Section2");

        rbnsssec21.setText("jRadioButton1");
        rbnsssec21.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbnsssec21ActionPerformed(evt);
            }
        });

        rbnsssec22.setText("jRadioButton1");
        rbnsssec22.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbnsssec22ActionPerformed(evt);
            }
        });

        rbnsssec23.setText("jRadioButton1");
        rbnsssec23.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbnsssec23ActionPerformed(evt);
            }
        });

        lblSection3.setText("Section3");

        chkChoice1.setText("jCheckBox1");
        chkChoice1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chkChoice1ActionPerformed(evt);
            }
        });

        chkChoice2.setText("jCheckBox2");
        chkChoice2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chkChoice2ActionPerformed(evt);
            }
        });

        jButton1.setText("Employee Summary");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(568, Short.MAX_VALUE)
                .add(jButton1)
                .addContainerGap())
            .add(jPanel2Layout.createSequentialGroup()
                .add(45, 45, 45)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(rbnsssec22)
                    .add(rbnsssec21)
                    .add(rbnsssec23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 354, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(lblSection2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 560, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(lblSection1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 476, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(rbnsssec13)
                    .add(rbnsssec12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 266, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(rbnsssec11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 420, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(lblHeader, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 552, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(146, Short.MAX_VALUE))
            .add(jPanel2Layout.createSequentialGroup()
                .add(55, 55, 55)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(chkChoice2)
                    .add(chkChoice1)
                    .add(lblSection3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 476, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(220, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .add(lblHeader, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(lblSection1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(rbnsssec11, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 41, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(7, 7, 7)
                .add(rbnsssec12)
                .add(18, 18, 18)
                .add(rbnsssec13, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(30, 30, 30)
                .add(lblSection2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(rbnsssec23)
                .add(18, 18, 18)
                .add(rbnsssec21)
                .add(18, 18, 18)
                .add(rbnsssec22)
                .add(18, 18, 18)
                .add(lblSection3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(6, 6, 6)
                .add(chkChoice1)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(chkChoice2)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jButton1)
                .addContainerGap(26, Short.MAX_VALUE))
        );

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(40, 40, 40))
        );

        jPanel2.getAccessibleContext().setAccessibleName("Health Plan Selection");

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void rbnsssec22ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbnsssec22ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_rbnsssec22ActionPerformed

private void rbnsssec13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbnsssec13ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_rbnsssec13ActionPerformed

private void chkChoice2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkChoice2ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_chkChoice2ActionPerformed

private void rbnsssec23ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbnsssec23ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_rbnsssec23ActionPerformed

private void rbnsssec21ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbnsssec21ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_rbnsssec21ActionPerformed

private void rbnsssec11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbnsssec11ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_rbnsssec11ActionPerformed

private void chkChoice1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkChoice1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_chkChoice1ActionPerformed

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    dispose();
    String doctorVisitString;
    String presDrugString;
    String familyString;
    
    
    FinalForm ff = new FinalForm();
    
}//GEN-LAST:event_jButton1ActionPerformed

private void rbnsssec12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbnsssec12ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_rbnsssec12ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(HealthPlanSelection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(HealthPlanSelection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(HealthPlanSelection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(HealthPlanSelection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new HealthPlanSelection().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox chkChoice1;
    private javax.swing.JCheckBox chkChoice2;
    private javax.swing.JButton jButton1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JLabel lblHeader;
    private javax.swing.JLabel lblSection1;
    private javax.swing.JLabel lblSection2;
    private javax.swing.JLabel lblSection3;
    private javax.swing.JRadioButton rbnsssec11;
    private javax.swing.JRadioButton rbnsssec12;
    private javax.swing.JRadioButton rbnsssec13;
    private javax.swing.JRadioButton rbnsssec21;
    private javax.swing.JRadioButton rbnsssec22;
    private javax.swing.JRadioButton rbnsssec23;
    // End of variables declaration//GEN-END:variables
}
